import { Controller, Get, Inject } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  // 全局变量
  @Inject('userInfo') private readonly userInfo: {
    name: string;
    age: string;
  };

  @Get()
  getHello(): string {
    console.log('213');

    return `${this.appService.getHello()},name=${this.userInfo.name},age=${
      this.userInfo.age
    }`;
  }
}
